Matplotlib is a comprehensive plotting library for the Python programming language.
#Introducing matplotlib library
import matplotlib.pyplot as plt
#Create subplots within the figure.
fig, ax = plt.subplots()
#Sample data
vegetables = ['potato', 'onion', 'turnip', 'carrot']
counts = [40, 100, 30, 55]
bar_labels = ['red', 'blue', '_red', 'orange']
bar_colors = ['tab:red', 'tab:blue', 'tab:red', 'tab:orange']
#Create a bar graph
ax.bar(vegetables, counts, label=bar_labels, color=bar_colors)
#Add labels and title
ax.set_ylabel('vegatable supply')
ax.set_title('Vegetable supply by kind and color')
ax.legend(title='Vegatble color')
#Display the plot
plt.show()
Seaborn is a statistical data visualization library based on Matplotlib.
#Importing required libraries
import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt
sns.set_theme(style="dark")
# Simulate data from a bivariate Gaussian
n = 10000
mean = [0, 0]
cov = [(2, .4), (.4, .2)]
rng = np.random.RandomState(0)
x, y = rng.multivariate_normal(mean, cov, n).T
# Draw a combo histogram and scatterplot with density contours
f, ax = plt.subplots(figsize=(6, 6))
sns.scatterplot(x=x, y=y, s=5, color=".15")
sns.histplot(x=x, y=y, bins=50, pthresh=.1, cmap="mako")
sns.kdeplot(x=x, y=y, levels=5, color="w", linewidths=1)
<Axes: >
Plotly Express is a terse, consistent, high-level API for creating figures.
#Importing plotly express
import plotly
import plotly.express as px
# required for rendering HTML correctly
plotly.offline.init_notebook_mode()
## Load the Gapminder dataset
df = px.data.gapminder()
## Create an area chart using Plotly Express
fig = px.area(df, x="year", y="pop", color="continent", line_group="country")
## Display the plot
fig.show()
Different Libraries of Python. Click Here for more information.
Given below is the table of monthly savings.
| S.No. | MONTH | SAVINGS |
|---|---|---|
| 1. | JANURAY | $500 |
| 2. | FEBRUARY | $725 |
| 3. | MARCH | $450 |
| 4. | APRIL | $600 |
| 5. | MAY | $200 |
| 6. | JUNE | $1000 |
My dream destination.
